import request from '@/utils/request'
import { getApiUrl } from '@/utils/request'

export function listEquipment(query) {
  return request({
    url: '/eqt/equipment/list',
    method: 'get',
    params: query
  })
}

export function createEquipment(data) {
  return request({
    url: '/eqt/equipment/create',
    method: 'post',
    data
  })
}

export function readEquipment(data) {
  return request({
    url: '/eqt/equipment/read/' + data.id,
    method: 'get'
  })
}

export function updateEquipment(data) {
  return request({
    url: '/eqt/equipment/update',
    method: 'post',
    data
  })
}

export function deleteEquipment(data) {
  return request({
    url: '/eqt/equipment/delete/' + data.fequipmentbarcode,
    method: 'delete'
  })
}

const uploadPath = getApiUrl() + 'eqt/equipment/upload'
export { uploadPath }
